PROP_FACTORY,
PROP_MODEL,
PROP_SHOW_SEPARATORS,
+ PROP_SINGLE_CLICK_ACTIVATE,
N_PROPS
};
g_value_set_boolean (value, self->show_separators);
break;
+ case PROP_SINGLE_CLICK_ACTIVATE:
+ g_value_set_boolean (value, gtk_list_item_manager_get_single_click_activate (self->item_manager));
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
gtk_list_view_set_show_separators (self, g_value_get_boolean (value));
break;
+ case PROP_SINGLE_CLICK_ACTIVATE:
+ gtk_list_view_set_single_click_activate (self, g_value_get_boolean (value));
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
FALSE,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
+ /**
+ * GtkListView:single-click-activate:
+ *
+ * Activate rows on single click and select them on hover
+ */
+ properties[PROP_SINGLE_CLICK_ACTIVATE] =
+ g_param_spec_boolean ("single-click-activate",
+ P_("Single click activate"),
+ P_("Activate rows on single click"),
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
+
g_object_class_install_properties (gobject_class, N_PROPS, properties);
/**
return self->show_separators;
}
+
+/**
+ * gtk_list_view_set_single_click_activate:
+ * @self: a #GtkListView
+ * @single_click_activate: %TRUE to activate items on single click
+ *
+ * Sets whether rows should be activated on single click and
+ * selected on hover.
+ */
+void
+gtk_list_view_set_single_click_activate (GtkListView *self,
+ gboolean single_click_activate)
+{
+ g_return_if_fail (GTK_IS_LIST_VIEW (self));
+
+ if (single_click_activate == gtk_list_item_manager_get_single_click_activate (self->item_manager))
+ return;
+
+ gtk_list_item_manager_set_single_click_activate (self->item_manager, single_click_activate);
+
+ g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_SINGLE_CLICK_ACTIVATE]);
+}
+
+/**
+ * gtk_list_view_get_single_click_activate:
+ * @self: a #GtkListView
+ *
+ * Returns whether rows will be activated on single click and
+ * selected on hover.
+ *
+ * Returns: %TRUE if rows are activated on single click
+ */
+gboolean
+gtk_list_view_get_single_click_activate (GtkListView *self)
+{
+ g_return_val_if_fail (GTK_IS_LIST_VIEW (self), FALSE);
+
+ return gtk_list_item_manager_get_single_click_activate (self->item_manager);
+}